//
//  TiledViewViewController.m
//  TiledView
//
//  Created by Kishikawa Katsumi on 10/03/22.
//  Copyright Kishikawa Katsumi 2010. All rights reserved.
//

#import "TiledViewViewController.h"
#import "TiledView.h"

@implementation TiledViewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
	
	_tiledView = [[TiledView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 2448.0f, 3264.0f)];
	_tiledView.tiledLayer.tileSize = CGSizeMake(245.0f, 327.0f);
	_tiledView.tiledLayer.levelsOfDetail = 1;
	_tiledView.tiledLayer.levelsOfDetailBias = 0;
	
    _scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 460.0f)];  
    _scrollView.contentSize = _tiledView.bounds.size;  
    _scrollView.maximumZoomScale = 4.0f;
	_scrollView.minimumZoomScale = 0.5f;
    _scrollView.delegate = _tiledView;
    [_scrollView addSubview:_tiledView];
	[_tiledView release];
	
    [self.view addSubview:_scrollView];
	[_scrollView release];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)dealloc {
    [super dealloc];
}

@end
